package com.aaa.marketresearch.dataresource.service;

import com.aaa.marketresearch.dataresource.dao.BillDAO;
import com.aaa.marketresearch.dataresource.domain.Bill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Nail
 */

@Service
public class BillServiceImpl implements BillService {

    @Autowired
    private BillDAO billDAO;

    @Transactional
    @Override
    public List<Bill> getAll() {
        return billDAO.getAll();
    }

    @Override
    public Bill getById(Integer id) {
        return billDAO.getById(id);
    }

    @Transactional
    @Override
    public void save(Bill bill) {
        billDAO.save(bill);
    }

    @Transactional
    @Override
    public boolean delete(Integer id) {
        return billDAO.delete(id);
    }
}
